const express = require('express')
const expressJoi = require('@escook/express-joi')
const { update_userinfo_schema } = require('../schema/user')
// 创建路由对象
const router = express.Router()
const userinfo_handler = require('../router_handler/userinfo')
const { update_password_schema } = require('../schema/user')
const { update_avatar_schema } = require('../schema/user')


// 获取用户的基本信息
router.get('/userinfo',userinfo_handler.getUserInfo)
//gengxing
router.post('/userinfo', expressJoi(update_userinfo_schema),
userinfo_handler.updateUserInfo)
//congzhi mima
router.post('/updatepwd', expressJoi(update_password_schema),
userinfo_handler.updatePassword)
//touxiang
router.post('/update/avatar', expressJoi(update_avatar_schema),
userinfo_handler.updateAvatar)


// 向外共享路由对象
module.exports = router